package com.test.simple.java;

import org.omg.IOP.Encoding;
import org.springframework.stereotype.Service;
import sun.nio.cs.ext.GBK;

import java.io.UnsupportedEncodingException;
import java.nio.charset.Charset;
import java.util.Arrays;

/**
 * Created by wangyg on 2016/10/27.
 */
@Service
public class AnnocationMethod {
	public void method1() {
		System.out.println("打印method1");
	}

	public void excute() {
		if (true) {
			System.out.println("nihao");
		}
		return;
	}

	public static void main(String[] args) throws UnsupportedEncodingException {
				String a="上海浦东新区";
				System.out.println("utf8编码下：["+a+"]占用"+a.getBytes("utf8").length+"个字节");
				System.out.println("gbk编码下：["+a+"]占用"+a.getBytes("gbk").length+"个字节");
				byte[] bytes=a.getBytes("gbk");
				System.out.println(Arrays.toString(bytes));
						String b=new String(bytes,"gbk");
						System.out.println(b);




//		AnnocationMethod am = new AnnocationMethod();
//		am.excute();


//	out: for (int i = 0; i <5 ; i++) {
//			System.out.println("开始第"+i+"次外层循环：");
//			for (int j = 0; j <5 ; j++) {
//				if(j==3)
//					break out;
//				//continue out;
//				System.out.println("值为:"+j);
//			}
//		}


	}
}
